#!/usr/bin/env python
from pylab import *

centroids = []
for cf in open('org.centroids.point', 'r'):
	centroids.append(cf.split('\t'))
	
datas = []
for dl in open('org.data.point', 'r'):
	# datas[dl]
	datas.append(dl.split('\t'))

pf = open('partition.txt', 'r')
partitions = pf.readline().split('\t')

# plot graph

props = dict( alpha=0.9, edgecolors='none' )

handles = []
# clrs = ['cyan', 'blue', 'green', 'yellow', 'red']
colours = ['cyan', 'blue', 'green', 'yellow', 'red']

for i in range(len(datas)):
	if int(partitions[i]) == 0:
		handles.append(scatter(float(datas[i][0]), float(datas[i][1]), c='cyan', s=30, **props))
	elif int(partitions[i]) == 1:
		handles.append(scatter(float(datas[i][0]), float(datas[i][1]), c='blue', s=30, **props))
	elif int(partitions[i]) == 2:
		handles.append(scatter(float(datas[i][0]), float(datas[i][1]), c='green', s=30, **props))
	else:
		handles.append(scatter(float(datas[i][0]), float(datas[i][1]), c='yellow', s=30, **props))

for j in range(len(centroids)):
	handles.append(scatter(float(centroids[j][0]), float(centroids[j][1]), c='red', s=50, **props))	
# for colour in colours:
    # x, y = rand(2,N)
    # s = 400.0 * rand(N)
    # handles.append(scatter(x, y, c=colour, s=100, **props))

legend(handles, colours)
grid(True)

show()

# cf.close()
# df.close()
pf.close()